package com.ydc.ln.tutorial.j2se.ms;

public class Ch1003 {
    public static void main(String[] args) {
        go(new MyBase());
    }

    static void go(Base b) {
        b.add(8);
    }
}


class Base {
    int i;

    Base() {
        add(1);
        System.out.println("Base con " + i);
    }

    void add(int v) {
        i += v;
        System.out.println("Base add " + i);
    }

    void print() {
        System.out.println("Base print " + i);
    }
}


class MyBase extends Base {
    MyBase() {
        add(2);
    }

    void add(int v) {
        i += v * 2;
        System.out.println("MyBase add " + i);
    }

}


// ---------------------------------
class Tester {
    int var;

    Tester(double var) {
        this.var = (int) var;
    }

    Tester(int var) {
        this("hello");
    }

    Tester(String s) {
        this();
        System.out.println(s);
    }

    Tester() {
        System.out.println("good-bye");
    }
}
